-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POS] Custom payment UI — Part 2 | Separating CardReaderPaymentController
's events from MultiLiveEvent
#12870
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
CardReaderPaymentController
's events from MultiLiveEvent
CardReaderPaymentController
's events from MultiLiveEvent
CardReaderPaymentController
's events from MultiLiveEvent
CardReaderPaymentController
's events from MultiLiveEvent
4 tasks
kidinov
reviewed
Nov 11, 2024
...test/kotlin/com/woocommerce/android/ui/payments/cardreader/CardReaderPaymentViewModelTest.kt
Outdated
Show resolved
Hide resolved
kidinov
approved these changes
Nov 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good. Tests well too.
I left one np in the test, please take a look!
4 tasks
Base automatically changed from
custom-payment-ui-1
to
feature/custom-payment-ui
November 19, 2024 14:36
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature: point of sale
POS project
status: do not merge
Dependent on another PR, ready for review but not ready for merge.
unit-tests-exemption
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Separating CardReaderPaymentController's events from MultiLiveEvent
Closes: #12823
This is part 2 of 5 PRs refactoring the Payment flow:
Description
This PR refactors the way
CardReaderPaymentController
emits events:CardReaderPaymentController
emits nowsealed class CardReaderPaymentEvent
instances. This is safer to operate on a set of (sealed) classes bound to the parent class. Additionally, this removes the dependency on theMultiLiveEvent.Event
andMultiLiveEvent
inCardReaderPaymentController
. These classes are not needed and desirable in Woo POS.CardReaderPaymentViewModel
subscribes to the controller'sevents
observable, maps it, and exposes in the form of the old model (extendingMultiLiveEvent.Event
) emitted byLiveData
—retrofitting the existing UI implementation.Testing information
As a result of the refactoring done within this PR, the app should work without any change. It's crucial to test the IPP flow in the store management and POS modes against regression. It may be useful to base on the test plan (pdfdoF-5Jz-p2).
The tests that have been performed
I tested the payment collection flow in both POS and store management modes, using card-present payment and TTP; and verified that the IPP flow works and is not changed.
Configurations:
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: